package cn.nebula.music.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class IndexController {

	@RequestMapping("/")
	public String index(@RequestParam(defaultValue = "0") String page, Model model, HttpSession session) {
		model.addAttribute("page", page);
		model.addAttribute("user", session.getAttribute("USER"));
		return "frontHomePage";
	}

	@RequestMapping("/index")
	public String frontHomePage(@RequestParam(defaultValue = "0") String page, Model model, HttpSession session) {
		model.addAttribute("page", page);
		return "index";
	}

}
